<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body >
<div id="app">
<h1>注册成功，即将跳转</h1>
</div>

</body>
<script src="http://img.mabach.cn/vue.js"></script>

<script src="http://img.mabach.cn/axios.js"></script>


<script th:inline="javascript">
    new Vue({
        el: '#app',

        data:{

            mobile:[[${mobile}]],
            code:[[${code}]],
            from:[[${from}]],




        },

        created(){


            setTimeout(this.fetchData,1500);



        },



        methods:{



            fetchData (){

                axios.post(`/api-oauth/mobile/login?mobile=${this.mobile}&code=${this.code}`).then(response => {
                    if (response.data.flag){
                    window.location=[[${from}]];
                }else{
                    alert("登陆失败")
                }



            });
            },



        },






    })
</script>
</html>